package com.tsingteng.cosfun.ui.cosfun.presenter;

import com.tsingteng.cosfun.bean.AwkwardBean;
import com.tsingteng.cosfun.bean.BaseDataBean;
import com.tsingteng.cosfun.bean.HomeBean;
import com.tsingteng.cosfun.callback.RxObserver;
import com.tsingteng.cosfun.common.Config;
import com.tsingteng.cosfun.mvp.presenter.BasePresenter;
import com.tsingteng.cosfun.ui.cosfun.contract.AwkwardContract;
import com.tsingteng.cosfun.ui.cosfun.contract.OpusContract;
import com.tsingteng.cosfun.ui.cosfun.imodel.AwkwardModel;
import com.tsingteng.cosfun.ui.cosfun.imodel.OpusModel;

public class AwkwardPresenter extends BasePresenter<AwkwardContract.IAwkwardView> implements AwkwardContract.IAwkwardPresenter {
    AwkwardModel awkwardModel = null;
    AwkwardContract.IAwkwardView iAwkwardView = null;

    public AwkwardPresenter() {
        this.awkwardModel = new AwkwardModel();
    }

    //尬聊列表
    @Override
    public void getAwkwardList(String page_no, String page_size, String id) {
        iAwkwardView = getView();
        RxObserver<AwkwardBean> rxObserver = new RxObserver<AwkwardBean>(this) {
            @Override
            protected void onFaile(int errorCode, String errorMsg) {
                iAwkwardView.showFail(errorMsg);
            }

            @Override
            protected void onSuccess(AwkwardBean awkwardBean) {
                iAwkwardView.succeed(awkwardBean);
            }
        };
        awkwardModel.getAwkwardList(page_no, page_size, id, rxObserver);
        addDisposable(rxObserver);
    }
}
